import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:zhrs/Model/message.dart';
import 'package:zhrs/Utils/windowsSize.dart';
import 'package:zhrs/mainpage/webviewpage.dart';
class newinformation extends StatelessWidget
{

  Function reset;
  newinformation( {this.newinformationss,this.reset} )
  {

  }
  List<newsinformation> newinformationss;
  @override
  Widget build(BuildContext context) {
    // TODO: implement build
    return Center(
      child:
        new GestureDetector(
        onTap: ()
         {
            reset(url: "https://www.dzsbk.cn/smartDemo/page/main/tzlb.html");
            //Navigator.push(context, new MaterialPageRoute(
            // builder :(context)=>new Webviewpage(url: "https://www.dzsbk.cn/smartDemo/page/main/tzlb.html",),
            // ));
           },
          child:  Container(
            width: windowsSize.mapViewWidth*0.95,
            //color: Colors.black12,
            child: Row(
              children: <Widget>[
                Container(
                    width: 50,
                    height:75 ,
                    // padding: EdgeInsets.only(top: windowsSize.mapViewHeight*0.16*0.1),
                    decoration: BoxDecoration(
                      border: Border.all(width:1,color: Colors.blue),
                      shape: BoxShape.rectangle,
                    ),
                    child:
                    Center(
                      child:  Text("最新通知",style: TextStyle(fontSize:windowsSize.mapViewWidth*0.05,color: Colors.blue),textAlign: TextAlign.center,),
                    )
                ),
                Container(
                  child:Column(
                    children: newinformationss.map((newsinformation)
                    {
                      if(newsinformation.index!=0)
                      {
                        return Container(
                          width: windowsSize.mapViewWidth*0.8,
                          child:  Row(
                            children: <Widget>[
                              Container(
                                child: Icon(Icons.arrow_right,color: Colors.blue,) ,
                              ),
                              Text(newsinformation.description),
                              Container(
                                width: windowsSize.mapViewWidth*0.4,
                                child:  Text(newsinformation.time,textAlign: TextAlign.right,style: TextStyle(color: Colors.grey),),
                              )
                            ],
                          ),
                        );
                      }
                      return Container(
                        width: windowsSize.mapViewWidth*0.8,
                        padding:EdgeInsets.only(top: windowsSize.mapViewHeight*0.16*0.1),
                        child:  Row(
                          children: <Widget>[
                            Container(
                              child: Icon(Icons.arrow_right,color: Colors.blue,) ,
                            ),
                            Text(newsinformation.description),
                            Container(
                              width: windowsSize.mapViewWidth*0.4,
                              child:  Text(newsinformation.time,textAlign: TextAlign.right,style: TextStyle(color: Colors.grey),),
                            )
                          ],
                        ),
                      );
                    }).toList(),
                  ) ,
                )
              ],
            ),
          )
        )
     ,
    );
  }
}